Skip to content

Conversation

@pranaygp
Copy link
Collaborator

Adds reusable helper methods to BaseBuilder for common path operations,
reducing code duplication and improving readability in builder subclasses.

Changes:

  • Added resolvePath() helper in BaseBuilder
  • Added ensureDirectory() helper in BaseBuilder
  • Updated StandaloneBuilder (both in @workflow/builders and @workflow/cli)
    to use the new helpers
  • Removed unnecessary imports from StandaloneBuilder

This simplifies path handling code from:
const path = resolve(this.config.workingDir, this.config.somePath);
await mkdir(dirname(path), { recursive: true });

To:
const path = this.resolvePath(this.config.somePath);
await this.ensureDirectory(path);

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

@changeset-bot
Copy link

changeset-bot bot commented Oct 26, 2025

🦋 Changeset detected

Latest commit: 0364bf5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/sveltekit Patch
workflow Patch
@workflow/world-testing Patch
@workflow/ai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Oct 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Comment Nov 4, 2025 7:25am
example-nextjs-workflow-webpack Ready Ready Preview Comment Nov 4, 2025 7:25am
example-workflow Ready Ready Preview Comment Nov 4, 2025 7:25am
workbench-nitro-workflow Ready Ready Preview Comment Nov 4, 2025 7:25am
workbench-nuxt-workflow Ready Ready Preview Comment Nov 4, 2025 7:25am
workbench-sveltekit-workflow Ready Ready Preview Comment Nov 4, 2025 7:25am
workbench-vite-workflow Ready Ready Preview Comment Nov 4, 2025 7:25am
workflow-docs Ready Ready Preview Comment Nov 4, 2025 7:25am

@pranaygp pranaygp force-pushed the pranaygp/add-builder-type-safety branch from 43397b2 to 3e05dc7 Compare November 3, 2025 22:27
@pranaygp pranaygp force-pushed the pranaygp/extract-path-helpers branch from 4294532 to cbd8775 Compare November 3, 2025 22:27
@TooTallNate TooTallNate force-pushed the pranaygp/add-builder-type-safety branch from 3e05dc7 to 07674c6 Compare November 4, 2025 07:05
Base automatically changed from pranaygp/add-builder-type-safety to main November 4, 2025 07:20
pranaygp and others added 2 commits November 3, 2025 23:22
…nions

Improves type safety by creating discriminated union types for builder-specific
configurations, making it clear which configuration options are required for
each builder type.

Changes:
- Created BaseWorkflowConfig interface with common options
- Created StandaloneConfig, VercelBuildOutputConfig, and NextConfig types
- Made WorkflowConfig a discriminated union based on buildTarget
- Added documentation for each configuration type
- Exported new types from @workflow/builders

This enables better IntelliSense and type checking when constructing builder
configurations, preventing invalid configuration combinations at compile time.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Adds reusable helper methods to BaseBuilder for common path operations,
reducing code duplication and improving readability in builder subclasses.

Changes:
- Added resolvePath() helper in BaseBuilder
- Added ensureDirectory() helper in BaseBuilder
- Updated StandaloneBuilder (both in @workflow/builders and @workflow/cli)
  to use the new helpers
- Removed unnecessary imports from StandaloneBuilder

This simplifies path handling code from:
  const path = resolve(this.config.workingDir, this.config.somePath);
  await mkdir(dirname(path), { recursive: true });

To:
  const path = this.resolvePath(this.config.somePath);
  await this.ensureDirectory(path);

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Nathan Rajlich <[email protected]>
@TooTallNate TooTallNate merged commit 10bfd4a into main Nov 4, 2025
30 checks passed
@TooTallNate TooTallNate deleted the pranaygp/extract-path-helpers branch November 4, 2025 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants